import base from './base'
import  axios from '@/utils/request'

const api ={
  totalInfo(){
    return axios.get(base.totalInfo)
  },
  orderinfo(){
    return axios.get(base.orderinfo)
  },
  // 图标数据
  format(){
    return axios.get(base.format)
  },
  // 产品列表
  projectList(params){
    return axios.get(base.projectList,{params})
  },
  //查询接口
  search(params){
    return axios.get(base.search,{params})
  },
  // 删除接口
  deleteItemById(params){
    return axios.get(base.delete,{params})
  },
  //商品类目
selectItemCategoryByParentId(params){
    return axios.get(base.selectItemCategoryByParentId,{params})
},
//商品添加接口
insertTbItem(params){
  return axios.get(base.insertTbItem,{params})
},
//批量删除
batchDelete(params){
    return axios.get(base.batchDelete,{params})
},
//修改商品
updateTbItem(params){
    return axios.get(base.updateTbItem,{params})
},
//产品分类
itemCategory(){
  return axios.get(base.itemCategory);
},
/* 
    新增子级类目
    params={cid name}
  */
    insertItemCategory(params) {
      return axios.get(base.insertItemCategory, { params });
    },
    /* 
        修改类目
        {id,name}
      */
    updateCategory(params) {
      return axios.get(base.updateCategory, { params });
    },
  
    /* 
        删除类目
        {id}
        */
    deleteContentCategoryById(params) {
      return axios.get(base.deleteContentCategoryById, { params });
    },
    /* 
        一级类目新增
        {name}
         */
    insertCategory(params) {
      return axios.get(base.insertCategory, { params });
    },

    // 订单列表
    orderList(params){
      return axios.get(base.orderList,{params})
    },

     /* 
    订单汇总---ids=''
    */
  changeStatus(params) {
    return axios.get(base.changeStatus, { params });
  },
  /* 
    汇总清单
    {page}
     */
    collect(params) {
      return axios.get(base.collect, { params });
    },
    /* 
        撤销汇总
        {id}
      */
    cancel(params) {
      return axios.get(base.cancel, { params });
    },
    /* 
        订单详情
        {id}
      */
    getDetail(params) {
      return axios.get(base.detail, { params });
    },
    // 登录
    login(params){
      return axios.post(base.login,params)
    },
    // 登录权限
    Permission(params){
        return axios.get(base.permission,{params})
    },
    Content(params){
          return axios.get(base.content,{params})
    }
}

export default api